---@diagnostic disable: lowercase-global, undefined-global, trailing-space

GLOBAL.setmetatable(env,{__index=function(t,k) return GLOBAL.rawget(GLOBAL,k) end})

---@type string
local modid = 'yuemiheng' -- 定义唯一modid

-- 
---@type LAN_TOOL_COORDS
YMHC = require('core_'..modid..'/utils/coords')
---@type LAN_TOOL_SUGARS
YMHS = require('core_'..modid..'/utils/sugar')

rawset(GLOBAL,'YMHC',YMHC)
rawset(GLOBAL,'YMHS',YMHS)

PrefabFiles = {
	-- 'yuemiheng_module_dishes',
	-- 'yuemiheng_module_particle',
	'yuemiheng_tool',
	'yuemiheng_spear',
	'yuemiheng_staff',
	'yuemiheng_cape',
	'yuemiheng_hat',

	'yuemiheng_shadow',

}

Assets = {
	Asset("ATLAS","images/inventoryimages/yuemiheng_shadow.xml"),
}

-- 导入mod配置
TUNING['CONFIG_'..string.upper(modid)..'_LANG'] = GetModConfigData(modid..'_lang')
TUNING[string.upper('CONFIG_'..modid..'_quickbuild')] = GetModConfigData(modid..'_quickbuild')
TUNING[string.upper('CONFIG_'..modid..'_punchdmg')] = GetModConfigData(modid..'_punchdmg')
TUNING[string.upper('CONFIG_'..modid..'_startlv')] = GetModConfigData(modid..'_startlv')
TUNING[string.upper('CONFIG_'..modid..'_staff_allow_cast_key')] = GetModConfigData(modid..'_staff_allow_cast_key')
TUNING[string.upper('CONFIG_'..modid..'_boss_buff')] = GetModConfigData(modid..'_boss_buff')

RegisterInventoryItemAtlas("images/inventoryimages/path.xml",'yuemiheng_shadow')

-- 导入常量表
modimport('scripts/core_'..modid..'/data/tuning.lua')

-- 导入工具
modimport('scripts/core_'..modid..'/utils/_register.lua')

-- 导入功能API
modimport('scripts/core_'..modid..'/api/_register.lua')

-- 导入语言文件
modimport('scripts/core_'..modid..'/languages/'..TUNING['CONFIG_'..string.upper(modid)..'_LANG']..'.lua')

if STRINGS.CHARACTERS.YUEMIHENG == nil then
    STRINGS.CHARACTERS.YUEMIHENG = {}
end
-- 台词
if TUNING['CONFIG_'..string.upper(modid)..'_LANG'] == 'cn' then
    STRINGS.CHARACTERS.YUEMIHENG = require('core_'..modid..'/languages/speech_cn')
end

-- 导入调用器
-- modimport('scripts/core_'..modid..'/callers/caller_badge.lua')
modimport('scripts/core_'..modid..'/callers/caller_ca.lua')
modimport('scripts/core_'..modid..'/callers/caller_container.lua')
-- modimport('scripts/core_'..modid..'/callers/caller_dish.lua')
modimport('scripts/core_'..modid..'/callers/caller_keyhandler.lua')
modimport('scripts/core_'..modid..'/callers/caller_recipes.lua')
-- modimport('scripts/core_'..modid..'/callers/caller_stack.lua')

-- 导入人物
modimport('scripts/data_avatar/data_avatar_yuemiheng.lua')

-- 导入UI
modimport('scripts/core_'..modid..'/ui/exp.lua')

-- 注册客机组件
AddReplicableComponent('ymh_eat_marble')
AddReplicableComponent('ymh_lv')

-- 导入钩子
modimport('scripts/core_'..modid..'/hooks/marble.lua')
modimport('scripts/core_'..modid..'/hooks/nodrown.lua')
modimport('scripts/core_'..modid..'/hooks/nocurse.lua')
modimport('scripts/core_'..modid..'/hooks/vision.lua')
modimport('scripts/core_'..modid..'/hooks/nosleep.lua')
modimport('scripts/core_'..modid..'/hooks/onlytakedmg.lua')
modimport('scripts/core_'..modid..'/hooks/quickaction.lua')
modimport('scripts/core_'..modid..'/hooks/lv_increase_absorb.lua')
modimport('scripts/core_'..modid..'/hooks/drain.lua')
modimport('scripts/core_'..modid..'/hooks/ymh_spear_double_loot.lua')
modimport('scripts/core_'..modid..'/hooks/nosteal.lua')
modimport('scripts/core_'..modid..'/hooks/yuemiheng_hat.lua')
modimport('scripts/core_'..modid..'/hooks/shadow.lua')
modimport('scripts/core_'..modid..'/hooks/lv_punch_dmg.lua')

-- AddPlayerPostInit(function(inst)
--     if not TheWorld.ismastersim then
--         return inst
--     end
--     -- inst:DoTaskInTime(3, function()
--     --     local sakura_rain = SpawnPrefab('steam_discount')
--     --     -- sakura_rain.entity:SetParent(inst.entity)
--     --     sakura_rain.entity:AddFollower()
--     --     sakura_rain.Follower:FollowSymbol(inst.GUID, nil, 0, 0, 0)
--     -- end)
-- end)

